<?php 
/*
* 站点首页选项卡
*/
if(!defined('EMLOG_ROOT')) {exit('error!');} 
?>
<form id="searchform" action="<?php echo BLOG_URL; ?>search/">
<input type="text" class="search"  name="q" id="s" value="" />
<input type="submit" class="searchb" value=""/>
</form>
<!-- //**********************************
   TABS POPULAR, RECENT, COMMENTS, TAGS
//*************************************** -->
<div id="dcbantabs" class="widget ">
<div id="tabsheader" class="tabsheader">
<ul class="tabnav" id="tabs">
<li><a>热门影视</a></li>
<li><a>最近更新</a></li>
<li><a>留言评论</a></li>
<li class="taglast"><a class="tagslast">标签云</a></li>
</ul>
</div><!-- #header -->
<div id="tabdiv" class="tabdiv">
<div id="populartab" style="display:block;"><!-- #popular -->
<div class="tab_inside">
<?php $date = time() - 3600 * 24 * 180;
      $Log_Model = new Log_Model();
	  $hotlogs = $Log_Model->getLogsForHome("and date > {$date} ORDER BY views DESC,date DESC", 0, 6);
	  foreach($hotlogs as $row){
		  ?>
<a href="<?php echo $row['log_url']; ?>">
 <img src="<?php logs_thumb($row,'53','43'); ?>" alt="<?php echo $row['log_title']; ?>" /></a>
<div class="content">
  <h1><a href="<?php echo $row['log_url']; ?>" title="<?php echo $row['log_title']; ?>"><?php echo extractHtmlData($row['log_title'],25); ?></a></h1> <br  /> 
<span class="date"><?php echo extractHtmlData($excerpt,25);?></span>
</div><!-- #content closer -->
<?php }?>
</div><!-- #tab_inside -->
</div><!--#popular -->


<div id="recenttab"><!-- #recent tab -->

<div class="tab_inside">
<?php 
      $Log_Model = new Log_Model();
	  $newlogs = $Log_Model->getLogsForHome("ORDER BY `date` DESC", 0, 6);
	  foreach($newlogs as $row){
		  ?>
<a href="<?php echo $row['log_url']; ?>">
 <img src="<?php logs_thumb($row,'53','43'); ?>" alt="<?php echo $row['log_title']; ?>" /></a>
<div class="content"><h1><a href="<?php echo $row['log_url']; ?>" title="<?php echo $row['log_title']; ?>"><?php echo extractHtmlData($row['log_title'],25); ?></a></h1> <br  /> 
<span class="date"><?php echo extractHtmlData($excerpt,25);?></span>
</div><!-- #content closer -->
<?php }?>
</div><!-- #tab_inside -->
</div><!--#recent tab -->


<div id="commentstab"><!-- #commentstab -->

<div class="tab_inside">
<?php {
	global $CACHE; 
	$com_cache = $CACHE->readCache('comment');
	?>
	<?php
	foreach($com_cache as $value):
	$url = Url::comment($value['gid'], $value['page'], $value['cid']);
	?>
<a href="<?php echo $url; ?>">
<img alt='<?php echo $value['name']; ?>' 
src='<?php echo getGravatar($value['mail']); ?>' class='avatar avatar-53 photo' height='53' width='53' /></a>
<div class="content"><h1><?php echo $value['name']; ?></h1> <br  /> 
<span class="date"><a href="<?php echo $url; ?>"><?php echo $value['content']; ?></a>
</span>
</div><!-- #content closer -->
<?php endforeach; ?>
<?php }?>
</div><!-- #tab_inside -->
</div><!-- #commentstab -->


<div id="tagtab"><!-- #tagtab -->
<div class="tab_inside">
<?php {
	global $CACHE;
	$tag_cache = $CACHE->readCache('tags');?>
	<?php $tag_cache = array_slice($tag_cache,0,28);
	      foreach($tag_cache as $value): ?>
<a href='<?php echo Url::tag($value['tagurl']); ?>' 
class='tag-link-38' title='<?php echo $value['usenum']; ?>篇文章' style='font-size:<?php echo $value['fontsize']; ?>pt; line-height:30px;'><?php echo $value['tagname']; ?></a>
<?php endforeach; ?>
<?php }?>
</div>
</div><!--#tagtab closer-->
</div>
</div><!--#tagtab -->

<!-- //**********************************
   TABS END
//*************************************** -->